/** * 将指定Array内的元素复制到目标Array中, 如果具有相同key, 则会被覆盖. **/ public static function copyArrayItems($source, $target) { foreach($source as $sourceItemKey=>$sourceItemValue) { $target[$sourceItemKey] = $sourceItemValue; } return $target; } /** * 移除$target数组中中带有 $source中元素相同key的元素. * @param $source * @param $target * @return unknown_type */ public static function removeArrayItems($source, $target) { foreach($source as $sourceKey => $sourseValue) { unset($target[$sourseValue]); } return $target; }
有关数组的操作: http://liguoliang.com/2010/php-array-简单操作小结/
PHP数学运算: 向上/向下取整及四舍五入 <->
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.